<?php

?>

<div class="admin_header_title">PROVIDER MANAGE</div>
<?php
    if($template->get('error'))
    {
        echo '<div class="metro_message_error"><i class="fa fa-exclamation-triangle"></i> '.$template->get('error').'</div>';
    }
    if($template->get('message'))
    {
        echo '<div class="metro_message_susscess"><i class="fa fa-check"></i> '.$template->get('message').'</div>';
    }
?>
<div class="metro_table green_metro_style">
    <div class="metro_table_title"><i class="fa fa-bars"></i> Add a New Provider</div>
    <div class="metro_table_content">
        <div style="padding: 20px;">
            <form action="" method="POST">
                <!---------------- Sector setting area ----------->
                <div style="margin-top:10px;">
                    <input type="text" disabled value="Provider Name" style="width: 150px;margin-right: -10px;">
                    <input type="text" name="tb_provider_name" style="width: 426px;" value="">
                </div>
                <div style="margin-top:10px;">
                    <input type="text" disabled value="Provider Alias" style="width: 150px;margin-right: -10px;">
                    <input type="text" name="tb_provider_alias" style="width: 426px;" value="">
                </div>
                <div style="margin-top:10px;">
                    <input type="text" disabled value="Provider Homepage" style="width: 150px;margin-right: -10px;">
                    <input type="text" name="tb_provider_homepage" style="width: 426px;" value="">
                </div>
                <div style="margin-top:10px;">
                    <input type="text" disabled value="Provider Endpoint" style="width: 150px;margin-right: -10px;">
                    <input type="text" name="tb_provider_endpoint" style="width: 426px;" value="">
                </div>
                <div style="text-align: right;margin-top:10px;width:616px;">
                    <button type="submit" class="flat_metro_button green_metro_style"><i class="fa fa-plus"></i> Add a new Provider</button>
                </div>
            </form>
        </div>
    </div>
</div>
<div class="metro_table orange_metro_style">
    <div class="metro_table_title"><i class="fa fa-bars"></i> List Provider</div>
    <div class="metro_table_content">
        <table>
            <thead>
                <tr>
                    <th><i class="fa fa-tag"></i> Provider Name</th>
                    <th><i class="fa fa-info"></i> Provider Alias</th>
                    <th><i class="fa fa-shield"></i> Provider HomePage</th>
                    <th><i class="fa fa-th"></i> Provider Endpoint</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                <?php
                    foreach($template->get('aProviders') as $aProvider)
                    {
                        echo '<tr val="'.$aProvider['producer_id'].'">';
                        echo '<td><a href="'.$aProvider['producer_homepage'].'">'.$aProvider['producer_name'].'</a></td>';
                        echo '<td>'.$aProvider['producer_alias'].'</td>';
                        echo '<td><a href="'.$aProvider['producer_homepage'].'">'.$aProvider['producer_homepage'].'</a></td>';
                        echo '<td><a href="'.$aProvider['producer_endpoint'].'">'.$aProvider['producer_endpoint'].'</a></td>';
                        echo '<td><button class="table_bt_metro_edit bt_edit_provider"><i class="fa fa-pencil"></i></button><button class="table_bt_metro_delete"><i class="fa fa-trash-o"></i></button></td>';
                        echo "</tr>";
                    }
                ?>
            </tbody>
        </table>
    </div>
</div>
